<?php
/**
 * SoldOutState Class
 * 售完的状态
 *
 */

class SoldOutState implements State {

    public $gumballMachine = null;

    public function __construct($gumballMachine)
    {
        $this->gumballMachine = $gumballMachine;
    }

    // 投币
    public function insertCoin()
    {
        echo "You can't insert a quarter, the machine is sold out.\n";
    }   

    // 退币
    public function ejectCoin()
    {
        echo "You can't eject, you haven't inserted a quarter yet.\n";
    }   

    // 转动摇柄
    public function turnCrank()
    {
        echo "You turned, but there are no gumballs!\n";
    }

    // 发糖果
    public function dispense()
    {
        echo "No gumball dispensed.\n";
    }

    public function show()
    {
        return "sold out.\n";
    }

}